<?php /*a:1:{s:64:"D:\web\www\tp5.1\public/../app/admin\view\game_log\tradegm1.html";i:1525784513;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>表单</title>
    <link rel="stylesheet" href="/static/frame/layui/css/layui.css">
    <link rel="stylesheet" href="/static/frame/static/css/style.css">
    <link rel="icon" href="/static/frame/static/image/code.png">
</head>
<body class="body">
<div class="tab-top layui-box layui-col-md-offset1">


<div class="search">
  <form class="layui-form" action="">
        <div class="layui-input-inline">
        <select name="search" lay-verify="required" class="search-name" lay-search="">
          <option value="chrname" <?php echo $search=='chrname' ? 'selected=""'  :  ''; ?>>玩家名</option>
          <option value="itemname" <?php echo $search=='itemname' ? 'selected=""'  :  ''; ?>>物品名</option>
          <option value="buylv" <?php echo $search=='buylv' ? 'selected=""'  :  ''; ?>>等级</option>
          <input type="hidden" name="id" value="<?php echo htmlentities($id); ?>">
        </select>
      </div>
  <div class="layui-inline">
    <input class="layui-input layui-input-sm" name="val" placeholder="请输入用户名" id="search-elm" autocomplete="off" value="<?php echo htmlentities($val); ?>">
  </div>
  <button class="layui-btn site-demo-active layui-btn-sm search-btn" data-type="reload">搜索</button>
</form>
</div>
</div>

<div class="system-table-1 layui-clear" style="padding-top:10px;">

<table class="layui-table" lay-filter="parse-table-demo" lay-data="{height:'full-120',url:'<?php echo url('admin/GameLog/tradegm1list',Request::param()); ?>', page:true, id:'test',limit:'<?php echo config('webconfig.page'); ?>'}">
  <thead>
    <tr>
      <th lay-data="{field:'id', width:80, sort: true}">ID</th>
      <th lay-data="{field:'logtime', width:100}">时间</th>
      <th lay-data="{field:'g', width:100}">发送者</th>
      <th lay-data="{field:'m', width:200}">接收者</th>
      <th lay-data="{field:'wid', width:100}">物品id</th>
      <th lay-data="{field:'position', width:80}">物品位置</th>
      <th lay-data="{field:'itemname', minwidth:120}">物品堆叠最大数量</th>
      <th lay-data="{field:'jmax', width:80}">交易物品堆叠数量</th>
    </tr> 
  </thead>
</table>

</div>
<button class="layui-btn getCheckData layui-btn-sm">删去选择中数据</button>
<!-- 通用-970*90 -->
<script src="/static/frame/layui/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/comm.js" charset="utf-8"></script>
<script type="text/javascript">
layui.use(['form', 'table'], function() {
    var $ = layui.jquery,
        form = layui.form,
        table = layui.table;
    // you code ...
  $('.getCheckData').on('click', function(){
  	var list = '';
      var checkStatus = table.checkStatus('test')
      ,data = checkStatus.data;
      console.log(data.length);
      for (var i = data.length - 1; i >= 0; i--) {
      	list += data[i].id + ',';
      }
      // 去除最后一位逗号
      list = list.substr(0, (list.length - 1));
	  $.post("<?php echo url('admin/LoginLog/deleteAll'); ?>", {'ids': list}, function(data) {
			if (data.code ==1) {
				layer.msg(data.msg, {time: 1000}, function() {
                      //执行重载
                    table.reload('test', {page: {curr: 1 }});
                });
			}else if(data != ""){
        layer.msg(data.msg);
      }
	   });
  });



});


</script>



</body>
</html>